import React from "react";
import PropTypes from "prop-types";

const IFrameComponent = React.memo(function IFrameComponent({ src }) {
  const styles = {
    width: "100%",
    height: "100%",
    border: "none",
  };

  return <iframe title="预览" src={src} style={styles} key={src} />;
});

IFrameComponent.propTypes = {
  src: PropTypes.string.isRequired,
};

export default IFrameComponent;
